<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数据导出</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
    <meta name="viewport" content="width=device-width, viewport-fit=cover">
    <link href="{$_G['URL']['LAYER_CSS']}/layui.css" rel="stylesheet">
    <link href="/web/resource/css/bootstrap.min.css?v={IMS_RELEASE_DATE}" rel="stylesheet">
    <style>
        #weixin-tip{display:none;position:fixed;left:0;top:0;background:rgba(0,0,0,0.8);filter:alpha(opacity=80);width:100%;height:100%;z-index:100;}
        #weixin-tip p{text-align:center;margin-top:10%;padding:0 5%;position:relative;}
        #weixin-tip .close{color:#fff;padding:5px;font:bold 20px/24px simsun;text-shadow:0 1px 0 #ddd;position:absolute;top:0;left:5%;}
        .btn-margin{
            margin-bottom:5px;
        }
        .form-group {
            margin-bottom: 5px;
        }
        .heading{
            height: 40px;
            /*background-color:#d9edf7;*/
            text-align: center;
            font-size: 15px;
            color: #777;
            border-bottom: 1px #c9c9c9 solid;
        }

    </style>
</head>
<body >
<div class="main" id="show_query">

        <div class="panel-heading heading" >
            <div class="col-sm-12 col-xs-12 col-md-2">{$total} 条数据</div>
        </div>

        <div class="panel-body">
            <form id = "myform" action="{php echo $_G['siteroot'].createMobileUrl('X_exportData',array('themeid'=>$themeid,'uid' => $_P['uid'],'key' => $_P['key']));}" method="post" class="form-horizontal" role="form">
                <input type="hidden" name="status" id="status"  value="{$status}" />
                <input type="hidden" name="type" id="type" value="{$type}" />
                <input type="hidden" name="yukuan" id="yukuan" value="{$yukuan}" />
                <input type="hidden" name="address" id="address" value="{$_P['address']}"/>
                <input type="hidden" name="formtwo" id="formtwo" value="{$_P['formtwo']}"/>
                <input type="hidden" name="shops" id="shops" value="{$_P['shops']}"/>
                <input type="hidden" name="category_pids" value="{$_P['category_pids']}" id="category_pids2"/>

                {if $status_btn}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-1 col-md-1 control-label">状态</label>
                    <div class="col-xs-12 col-sm-9 col-md-9">
                        {loop $status_btn $btn1}
                             <button type="button" onclick="baseSelcet('status','{$btn1['status']}')" class="btn btn-margin {if $status == $btn1['status']}btn-primary{else}btn-default{/if}">{$btn1['name']} {if isset($btn1['num'])}<span style="color: #ff0000">{$btn1['num']}</span>{/if}</button>
                        {/loop}
                        {loop $yushou_btn $btn2}
                             <button type="button" onclick="baseSelcet('yukuan','{$btn2['yukuan']}')" class="btn btn-margin {if $yukuan == $btn2['yukuan']}btn-primary{else}btn-default{/if}">{$btn2['name']} {if isset($btn2['num'])}<span style="color: #ff0000">{$btn2['num']}</span>{/if}</button>
                        {/loop}
                    </div>
                </div>
                {/if}

                {if $range_btn}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-1 control-label">范围</label>
                    <div class="col-xs-12 col-sm-6 col-md-9">
                        {loop $range_btn $btn}
                         <button type="button" onclick="baseSelcet('type','{$btn['type']}')" class="btn btn-margin {if $type == $btn['type']}btn-primary{else}btn-default{/if}">{$btn['name']} {if isset($btn['num'])}<span style="color: #ff0000">{$btn['num']}</span>{/if}</button>
                        {/loop}
                    </div>
                </div>
                {/if}

                {if $address_btn}
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-1 control-label">{$address_btn['title']}</label>
                        <div class="col-sm-8 col-xs-12 col-md-8">
                                {loop $address_btn['btn'] $btn5}
                                 <button  type="button" onclick="baseSelcet('{$btn5['url_type']}','{$btn5['url_type_value']}')"  class="btn btn-margin {if $btn5['select']==1}btn-primary{else}btn-default{/if}">{$btn5['name']} {if isset($btn5['num'])}
                                     <span style="color: #8ccdfb">{$btn5['num']}</span>{/if}</button>
                                {/loop}
                            </div>
                     </div>
                {/if}

                {if $formtwo_btn}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">{$formtwo_btn['title']}</label>
                    <div class="col-sm-8 col-xs-12 col-md-8">
                            {loop $formtwo_btn['btn'] $btn4}
                                 <button  type="button" onclick="baseSelcet('{$btn4['url_type']}','{$btn4['url_type_value']}')"  class="btn btn-margin  {if $btn4['select']==1}btn-primary{else}btn-default{/if}">{$btn4['name']} {if isset($btn4['num'])}
                                     <span style="color: #8ccdfb">{$btn4['num']}</span>{/if}</button>
                            {/loop}
                    </div>
                </div>
                {/if}

                {if $options_btn}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">{$options_btn['title']}</label>
                    <div class="col-sm-8 col-xs-12 col-md-8">
                            {loop $options_btn['btn'] $btn3}
                                <button  type="button" onclick="baseSelcet('{$btn3['url_type']}','{$btn3['url_type_value']}')"  class="btn btn-margin {if $btn3['select']==1}btn-primary{else}btn-default{/if}">{$btn3['name']} {if isset($btn3['num'])}
                                    <span style="color: #8ccdfb">{$btn3['num']}</span>{/if}</button>
                            {/loop}
                    </div>
                </div>
                {/if}

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">员工</label>
                    <div class="col-sm-3 col-lg-3 col-md-3 col-xs-12">
                        <select class="form-control" name="workerid" id="workerid">
                            <option value="" >全部</option>
                            {loop $wlist $row}
                               <option value="{$row['uid']}" {if $workerid == $row['uid'] }selected="selected"{/if}>{if $system['is_multiple_merchants']}{$row['companyname']}-{/if}{$row['teamname']}-{$row['username']}</option>
                            {/loop}
                        </select>
                    </div>
                </div>

                {if !empty($tuan_num_info)}
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-1 control-label">团人数</label>
                        <div class="col-sm-8 col-lg-8 col-md-8 col-xs-12">
                            {loop $tuan_num_info $row}
                            <label class="radio-inline" style="padding-left: 0px;">
                                <input name="tuannum[]" type="checkbox" value="{$row['tuannum']}"   {if in_array($row['tuannum'],$tuannum )} checked {/if} >
                                {$row['tuannum']}人<span style="color: #999999">{php echo str_replace('组','',$row['total']);}团</span>
                            </label>
                            {/loop}
                        </div>
                    </div>
                {/if}

                <div class="form-group clearfix">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">下单时间</label>
                    <div class="col-sm-4 col-lg-4 col-md-4 col-xs-6">
                        <input type="text" class="layui-input" name="starttime" id="starttime" placeholder="选择开始时间" value="{$starttime}">
                    </div>
                    <div class="col-sm-4 col-lg-4 col-md-4 col-xs-6">
                        <input type="text" class="layui-input" name="endtime" id="endtime" placeholder="选择结束时间" value="{$endtime}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">关键字</label>
                    <div class="col-sm-4 col-lg-4 col-md-4 col-xs-8" >
                        <input class="form-control" name="keyword" id="keyword" placeholder="可输入昵称、姓名、手机、团号" type="text" value="{$_P['keyword']}">
                    </div>
                    <div class="col-sm-1 col-lg-1 col-md-1 col-xs-2" style="padding-left: 0">
                        <button  class="btn btn-primary" id="select_btn">搜索</button>
                    </div>
                    <div class="col-sm-1 col-lg-1 col-md-1 col-xs-2" style="padding-left: 0">
                        <button type="button" class="btn btn-default" id="refresh">重置</button>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12 text-center">
                        <input class="btn btn-primary" type="submit" name="export_submit1" id="export_submit1" value="导出EXCEL">
                    </div>
                </div>
            </form>
        </div>
    </div>

</body>
<script type="text/javascript" src="{$_G['URL']['PUBLIC_JS']}fcwork/jquery.js?v=33"></script>
<script type="text/javascript" src="{$_G['URL']['LAYER_CSS']}/layui.js"></script>
<script>
    layui.use(['laydate','table'],function () {
        var laydate = layui.laydate;
        var table =  layui.table;
        //日期时间选择器
        laydate.render({
            elem: '#starttime'
            ,type: 'datetime'
            ,done: function(value, date){
                $("#starttime").val(value)
            }
        });

        laydate.render({
            elem: '#endtime'
            ,type: 'datetime'
            ,done: function(value, date){
                $("#datetime").val(value)
            }
        });
    });

    $('#refresh').click(function (){
        var t = $('#myform').serializeArray();
        $.each(t, function (index, item) {
            if(item.name=='type') {
                $('#'+item.name).val(-1);
            }else if(item.name=='status'){
                $('#'+item.name).val(-10);
            }else if(item.name=='tuannum[]'){
                $("input[name='tuannum[]']").val('');
            }else{
                $('#'+item.name).val('');
            }
        });
        $('#myform').submit();
    });
    //跳转
    function  baseSelcet(filed,value){
        if(value==='0'){
            $('#'+filed).val("'"+value+"'");
        }else{
            $('#'+filed).val(value);
        }
        $('#myform').submit();
    }

</script>
</html>